package com.hightrast.service.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hightrast.service.api.baseEntity.R;
import com.hightrast.service.api.domain.qo.rastOrderItem.QueryOrderProductItemsQo;
import com.hightrast.service.api.domain.qo.rastOrderItem.UpdateOrderProductItemsPaybackStatusQo;
import com.hightrast.service.api.domain.vo.rastOrderItem.QueryOrderProductItemsVo;
import com.hightrast.service.service.IRastOrderProductItemsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 订单商品项表 前端控制器
 * </p>
 *
 * @author hx
 * @since 2025-01-24
 */
@RestController
@RequestMapping("/api/rast-order-product-items")
@Api(tags = "订单商品项")
public class RastOrderProductItemsController {

    @Resource
    IRastOrderProductItemsService orderProductsService;

    @ApiOperation("获取商品订单列表")
    @PostMapping("/queryOrderProductItems")
    public R<IPage<QueryOrderProductItemsVo>> queryOrderProductItems(@RequestBody @Validated QueryOrderProductItemsQo qo) {
        return R.data(orderProductsService.queryOrderProductItems(qo));
    }

    @ApiOperation("修改商品佣金项支付状态")
    @PostMapping("/updateOrderProductItemsPaybackStatus")
    public R<IPage<QueryOrderProductItemsVo>> updateOrderProductItemsPaybackStatus(@RequestBody @Validated UpdateOrderProductItemsPaybackStatusQo qo) {
        orderProductsService.updateOrderProductItemsPaybackStatus(qo);
        return R.success();
    }

}
